-
Notifications
You must be signed in to change notification settings - Fork 0
Review neu #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: empty2
Are you sure you want to change the base?
Review neu #10
Conversation
After log out user couldn't open socket connection without reload.
Fix bug with socket initiation
Left some warnings/errors to know where to eke out unhandled actions
BackToNav was misleading name of the component. Improves readability.
…n, add preview if conversation exists -Add Redirect inside component, depending on newly created conversation -Check existence of DM conversation, if exists show preview, after submit redirect to created/existed conversation -Fix avatar, and heading display
…nut, add clearing data to SelectType.js Clearing data on unmount of NewConveration was causing clearing data on changing route. It was unwanted action, decided to add clear action whenever user hit SelectType route
Add missing functionalities, fix redirect.
…nnecessary comment
… unnecessary comment - Change name isMobile to isSmallScreen, small screen doesn't have to be mobile - Sidebar is rendered conditionally to improve performance
When new message received or created, the newest chats didn't go to first position
The name did not correspond to the performen action
… unnecessary comment
*Change sending animation from keyframes to react-spring *Fix rerender component to display sending animation correctly by wrap component by React.memo *Remove unnused scss lines, change name of svg component
Hook which returns boolean representing is element is visible on screen
Scrolling functionalities: * When conversation show-up, automatically scroll messages to bottom * When new message create or received scroll to bottom * When scroll to top get messages history (it's not finished, waiting for backend)
Make it work after break
Probably temporary fix, but have more important things to do than configuration npm packages
Fix create-react-app app warning asociated to failing to load source map
Probably temporary fix, but have more important things to do than configuration npm packages
* Configure eslint, apply changes coming from linter * Move back to setupProxy.js instead .ts ?
* Add process.env.API_PROD_URL * Add environmental dependency in url's connections * Delete CI env variable in env setup * Add netlify.toml to deploy without 404 etc. * Add build folder to git ignore * Add setupProxy.js and configure proxy for development
* Update socket.io to correct connection with cookies * Update socket.io initiation on files * Fix: Update url in setupProxy.js, because it's work only in dev mode
Add typescript and prepare to deploy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few more comments:
- I don't think redux is required for an app of this complexity - read more on composition https://felixgerschau.com/react-component-composition/
- You are using custom hooks as kind of controller for react views, its an overkill
- TS is lacking here
- No tests
"private": true, | ||
"homepage": "https://chatark.netlify.app/", | ||
"dependencies": { | ||
"@testing-library/jest-dom": "^4.2.4", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its dev dependency, in general its not that important what section it's in but sometime tools use this distinction to optimise end package size
@@ -0,0 +1,15 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its important to keep app metadata updated
@@ -0,0 +1,10 @@ | |||
/* eslint-disable no-undef */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should disable eslint rules, but sometimes if 3rd party lib code is broken we have to do that. In such a case one should disable eslint for certain line, not whole file
import { render } from '@testing-library/react'; | ||
import App from './pages/App'; | ||
|
||
test('renders learn react link', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when writing tests you should always answer this question - is this test helpful? I know this is an example test from react create app, but its a good place to talk about this. In this case this test does not make sense because app.js contained this link in jsx without any conditional logic
@@ -0,0 +1,15 @@ | |||
// Signing in | |||
export const SIGN_IN_SUCCESS = 'SIGN_IN_SUCCESS'; | |||
export const SIGN_IN_FAIL = 'SIGN_IN_FAIL'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be SIGN_IN_FAILURE, same everywhere else
<Link | ||
to={{ | ||
pathname: `${PROFILE_USER_WITHOUT_ID}${id}`, | ||
state: { from: location.pathname }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the purpose of storing origination path in route state? I saw only that you use it to mimic browser back button - there are built in methods for that
} | ||
}, [searchUsers, searchValue]); | ||
|
||
useEffect(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you have two use effects that are recalculating based on same searchValue prop. Check https://blog.battlefy.com/how-to-escape-react-hooks-hell-a66c0d142c9e
return false; | ||
} | ||
const membersIds = [ | ||
...new Set([...receivers.map((receiver) => receiver.id), userId]), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why set here converted to array, are you trying to commit duplicates in array that way?
|
||
if (createdConversation) { | ||
return ( | ||
<Redirect |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bizarre way of doing redirects. You should opt out from putting such a business logic into jsx
type="text" | ||
value={searchValue} | ||
onChange={(e) => { | ||
handleSearchChange(e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand this separation here
No description provided.